package com.mhy.aop.advice;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MyAdvice {

    @Before("pt()")
    public void beforeAdvice(){
        System.out.println("当前时间 "+System.currentTimeMillis()+" ms");
    }

    @Pointcut("execution(* com.mhy.aop.dao.BookDao.*(..))")
    public void pt(){
        System.out.println("MyAdvice.myPointcut()");
    }
}
